#ifndef QTERMINALWIDGET_H
#define QTERMINALWIDGET_H

#include <QWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QGroupBox>
#include <QCheckBox>
#include <QPlainTextEdit>

class QTerminalWidget : public QWidget
{
  Q_OBJECT
public:
  QTerminalWidget(QWidget *parent = 0);

signals:
  void dataOut(QByteArray);
public slots:
  void dataIn(QByteArray);

private:
  // GUI OBJECTS

  // COMM OBJECTS
  QVBoxLayout *settingsLayout;
  QHBoxLayout *liveLayout;
  QHBoxLayout *packetLayout;
  QHBoxLayout *packetSettingsLayout;
  QHBoxLayout *displaySettingsLayout;
  QGroupBox *liveBox;
  QLineEdit *liveEdit;
  QGroupBox *packetBox;
  QLineEdit *packetEdit;
  QCheckBox *hexCheck;
  QPushButton *sendButton;
  QGroupBox *displayBox;
  QCheckBox *updateCheck;
  QPushButton *clearButton;

  // DISPLAY OBJECTS
  QVBoxLayout *displayLayout;
  QPlainTextEdit *asciiLog;
  QPlainTextEdit *hexLog;

  QHBoxLayout *mainLayout;

  // VARIABLES


  // FUNCTIONS
  void init();

private slots:
  void clearTerminal();
  void datatoServer(QString);
  void togglehexPacket(bool);
  void packetModified(QString);
  void sendPacket();

};

#endif // QTERMINALWIDGET_H
